i2c: bcm2835: Add support for Repeated Start Condition
authorNoralf Trønnes <noralf@tronnes.org>
Fri, 23 Sep 2016 02:54:27 +0000 (04:54 +0200)
committerRaspbian kernel package updater <root@raspbian.org>
Thu, 15 Feb 2018 17:28:33 +0000 (17:28 +0000)
commit207e7c90c755ee8355f849dcef9d73a3ada580b9
treefe2c7c0ff45b84a1c9457ab75310e8eb1313b29b
parent1d3d9d4c7666bda49eb278f4b7871587eea87685
i2c: bcm2835: Add support for Repeated Start Condition

Documentation/i2c/i2c-protocol states that Combined transactions should
separate messages with a Start bit and end the whole transaction with a
Stop bit. This patch adds support for issuing only a Start between
messages instead of a Stop followed by a Start.

This implementation differs from downstream i2c-bcm2708 in 2 respects:
- it uses an interrupt to detect that the transfer is active instead
  of using polling. There is no interrupt for Transfer Active, but by
  not prefilling the FIFO it's possible to use the TXW interrupt.
- when resetting/disabling the controller between transfers it writes
  CLEAR to the control register instead of just zero.
  Using just zero gave many errors. This might be the reason why
  downstream had to disable this feature and make it available with a
  module parameter.

I have run thousands of transfers to a DS1307 (rtc), MMA8451 (accel)
and AT24C32 (eeprom) in parallel without problems.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Eric Anholt <eric@anholt.net>
drivers/i2c/busses/i2c-bcm2835.c